﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using Sinacor.Infra.UI.Common;
using Sinacor.Infra.UI.Security.Services;
using Sinacor.UI.Bovespa.Contabil.Communication.Bovespa.Contabil.ContaContabil;

namespace Sinacor.UI.Bovespa.Contabil.Communication.Translator.DataContractToModel
{
    /// <summary>
    /// FGualberto.7COMm - Task: 6312
    /// </summary>
    public class HistoricoContabil
    {
        /// <summary>
        /// Para Histórico Contabil - Unitário
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        public Model.HistoricoContabil ToHistoricoContabil(HistoricoContabilResponse response)
        {
            Model.HistoricoContabil to = new Sinacor.UI.Bovespa.Contabil.Model.HistoricoContabil();

            to.Codigo = response.Codigo;
            to.Digito = response.Digito;
            to.Descricao = response.Descricao;

            return to;

        }

        /// <summary>
        /// Para Histórico Contabil - Coleção
        /// </summary>
        /// <param name="responseList"></param>
        /// <returns></returns>
        public ModelCollection<Model.HistoricoContabil> ToHistoricoContabil(List<HistoricoContabilResponse> responseList)
        {
            ModelCollection<Model.HistoricoContabil> lista = new ModelCollection<Sinacor.UI.Bovespa.Contabil.Model.HistoricoContabil>();

            foreach (HistoricoContabilResponse response in responseList)
            {
                Model.HistoricoContabil to = new Sinacor.UI.Bovespa.Contabil.Model.HistoricoContabil();

                to.Codigo = response.Codigo;
                to.Digito = response.Digito;
                to.Descricao = response.Descricao;

                lista.Add(to);
            }

            return lista;

       }
    }
}
